package com.company.service;

public enum MonthEnum {
    Jan(1, "1月"),
    Feb(2, "2月"),
    Mar(3, "3月"),
    Apr(4, "4月"),
    May(5, "5月"),
    Jun(6, "6月"),
    Jul(7, "7月"),
    Aug(8, "8月"),
    Sep(9, "9月"),
    Oct(10, "10月"),
    Nov(11, "11月"),
    Dec(12, "12月");

    int value;
    String desc;

    MonthEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    public static String getDesc(int value) {
        MonthEnum[] monthEnums = values();
        for (MonthEnum monthEnum : monthEnums) {
            if (monthEnum.value().equals(value)) {
                return monthEnum.desc();
            }
        }
        return null;
    }

    private String desc() {
        return this.desc;
    }
    private Integer value() {
        return this.value;
    }

}
